package org.swust.monitor.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.swust.monitor.entity.R;
import org.swust.monitor.entity.dto.SysUserCountByDept;
import org.swust.monitor.service.ISysDeptService;

import java.util.List;


/**
* 部门 前端控制器
*
* @author hanxinxin
* @since 2025-01-06
 */
@RestController
@RequestMapping("/dept")
public class SysDeptController {
    @Autowired
    private ISysDeptService deptService;

    /*
     * 统计部门人数
     * @return
     */
    @GetMapping("/count")
    public R<List<SysUserCountByDept>> countWorker() {
        return R.ok(deptService.countWorker());
    }
}
